<template>
  <div>
    <div>我是子组件</div>
    <div>
      <button @click="eventMsg">触发兄弟组件</button>
    </div>
  </div>
</template>
<script>
import eventBus from '../eventBus'
export default {
  data() {
    return {
      isNum: 1
    }
  },
  // 接收值
  // inject: ["msg1","msgFun"],
  mounted() {
    // console.log(this.msg1)
    // console.log(this.msgFun())
  },
  methods: {
    eventMsg() {
      eventBus.$emit('postMsg',this.isNum++)
    }
  }
}
</script>